<template>
  <el-aside :width="$store.state.isCollapsed ? '64px' : '200px'">
    <el-menu
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      router
      :collapse="$store.state.isCollapsed"
      :collapse-transition="false"
      :default-active="$route.fullPath"
    >
      <el-menu-item index="/index">
        <el-icon><ChromeFilled /></el-icon>
        <span>首页</span>
      </el-menu-item>
      <el-menu-item index="/center">
        <el-icon><SwitchFilled /></el-icon>
        <span>个人中心</span>
      </el-menu-item>
      <el-sub-menu index="/news-manage">
        <template #title>
          <el-icon><MostlyCloudy /></el-icon>
          <span>新闻管理</span>
        </template>
        <el-menu-item index="/news-manage/newsadd">新增新闻</el-menu-item>
        <el-menu-item index="/news-manage/newslist">新闻列表</el-menu-item>
      </el-sub-menu>
      <el-sub-menu index="/product-manage">
        <template #title>
          <el-icon><ElementPlus /></el-icon>
          <span>产品管理</span>
        </template>
        <el-menu-item index="/product-manage/productadd">新增产品</el-menu-item>
        <el-menu-item index="/product-manage/productlist"
          >产品列表</el-menu-item
        >
      </el-sub-menu>
      <el-sub-menu index="/user-manage">
        <template #title>
          <el-icon><Shop /></el-icon>
          <span>用户管理</span>
        </template>
        <el-menu-item index="/user-manage/useradd">新增用户</el-menu-item>
        <el-menu-item index="/user-manage/userlist">用户列表</el-menu-item>
      </el-sub-menu>
    </el-menu>
  </el-aside>
</template>

<script setup></script>

<style lang="scss" scoped>
.el-aside {
  height: 100vh;
  .el-menu {
    height: 100%;
  }
}
</style>
